package com.orphan.marketBack.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.orphan.marketBack.po.MallUserdetail2;
import com.orphan.marketBack.po.dto.UsersManage;
import com.orphan.marketBack.vo.UserVo;
import com.orphan.util.dto.UsersManageDto;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * <p>
 * Mapper 接口
 * </p>
 *
 * @author wanghaiyu
 * @since 2021-07-13
 */
@Repository("mallUserdetail2Mapper")
public interface MallUserdetail2Mapper extends BaseMapper<MallUserdetail2> {
  @Select("SELECT * FROM mall_userdetail2 mall JOIN user_details user on  mall.user_id=`user`.u_id ")
  List<UsersManage> userAll();
  @Update("UPDATE mall_userdetail2 mall,user_details det set " +
          " mall.`level`=#{level},mall.is_frozen = #{isFrozen},det.user_name=#{userName},det.real_name=#{realName}, det.accumulated=#{accumulated},det.tel=#{tel} " +
          " WHERE mall.user_id = det.u_id and mall.detail_id=#{detailId}")
  int updateUser(UsersManage user);

  List<UserVo>UserSelect(UserVo userVo);
}
